4 # Make command line options:
5 # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
6 # -DNO_CLEAN do not clean at all
7 # -DNO_SHARE do not go into share subdir
8 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
9 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
10 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
11 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
12 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
13 # -DNO_CTF do not run the DTrace CTF conversion tools on built objects
14 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
15 # TARGET="machine" to crossbuild world for a different machine type
18 # The intended user-driven targets are:
19 # buildworld - rebuild *everything*, including glue to help do upgrades
20 # installworld- install everything built by "buildworld"
21 # doxygen - build API documentation of the kernel
22 # update - convenient way to update your source tree (eg: cvsup/cvs)
24 # Standard targets (not defined here) are documented in the makefiles in
25 # /usr/share/mk. These include:
26 # obj depend all install clean cleandepend cleanobj
30 # We must do share/info early so that installation of info `dir'
31 # entries works correctly. Do it first since it is less likely to
32 # grow dependencies on include and lib than vice versa.
34 # We must do lib/ and libexec/ before bin/, because if installworld
35 # installs a new /bin/sh, the 'make' command will *immediately*
36 # use that new version. And the new (dynamically-linked) /bin/sh
37 # will expect to find appropriate libraries in /lib and /libexec.
39 SUBDIR= share/info lib libexec
41 .if ${MK_GAMES} != "no"
44 .if ${MK_CDDL} != "no"
50 .if ${MK_KERBEROS} != "no"
53 .if ${MK_RESCUE} != "no"
57 .if ${MK_CRYPT} != "no"
60 .if !defined(NO_SHARE)
63 SUBDIR+=sys usr.bin usr.sbin
65 # We must do etc/ last for install/distribute to work.
69 # These are last, since it is nice to at least get the base system
70 # rebuilt before you do them.
71 .for _DIR in ${LOCAL_DIRS}
72 .if exists(${.CURDIR}/${_DIR}/Makefile)
77 .if defined(SUBDIR_OVERRIDE)
78 SUBDIR= ${SUBDIR_OVERRIDE}
84 .if defined(NO_CLEANDIR)
85 CLEANDIR= clean cleandepend
91 CVSFLAGS?= -r RELENG_7_2 -P -d -I!
95 SUPFLAGS+= -h ${SUPHOST}
98 MAKEOBJDIRPREFIX?= /usr/obj
99 .if !defined(OSRELDATE)
100 .if exists(/usr/include/osreldate.h)
101 OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
102 /usr/include/osreldate.h
108 .if !defined(VERSION)
110 VERSION+= ${OSRELDATE}
113 # Guess machine architecture from machine type, and vice versa.
114 .if !defined(TARGET_ARCH) && defined(TARGET)
115 TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/}
116 .elif !defined(TARGET) && defined(TARGET_ARCH) && \
117 ${TARGET_ARCH} != ${MACHINE_ARCH}
118 TARGET= ${TARGET_ARCH}
120 # Otherwise, default to current machine type and architecture.
122 TARGET_ARCH?= ${MACHINE_ARCH}
124 KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 powerpc sparc64 sparc64/sun4v
125 .if ${TARGET} == ${TARGET_ARCH}
128 _t= ${TARGET_ARCH}/${TARGET}
131 .if empty(KNOWN_ARCHES:M${_t})
132 .error Unknown target ${TARGET_ARCH}:${TARGET}.
136 .if ${TARGET} == ${MACHINE}
137 TARGET_CPUTYPE?=${CPUTYPE}
142 .if !empty(TARGET_CPUTYPE)
143 _TARGET_CPUTYPE=${TARGET_CPUTYPE}
145 _TARGET_CPUTYPE=dummy
147 _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
148 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
149 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
150 .error CPUTYPE global should be set with ?=.
153 BUILD_ARCH!= uname -p
154 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
155 .error To cross-build, set TARGET_ARCH.
158 .if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING)
159 OBJTREE= ${MAKEOBJDIRPREFIX}
161 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
163 WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
164 # /usr/games added for fortune which depend on strfile
165 BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
166 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
167 STRICTTMPPATH= ${BPATH}:${XPATH}
168 TMPPATH= ${STRICTTMPPATH}:${PATH}
170 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
173 # Building a world goes through the following stages
175 # 1. legacy stage [BMAKE]
176 # This stage is responsible for creating compatibility
177 # shims that are needed by the bootstrap-tools,
178 # build-tools and cross-tools stages.
179 # 1. bootstrap-tools stage [BMAKE]
180 # This stage is responsible for creating programs that
181 # are needed for backward compatibility reasons. They
182 # are not built as cross-tools.
183 # 2. build-tools stage [TMAKE]
184 # This stage is responsible for creating the object
185 # tree and building any tools that are needed during
187 # 3. cross-tools stage [XMAKE]
188 # This stage is responsible for creating any tools that
189 # are needed for cross-builds. A cross-compiler is one
191 # 4. world stage [WMAKE]
192 # This stage actually builds the world.
193 # 5. install stage (optional) [IMAKE]
194 # This stage installs a previously built world.
199 # Common environment for world related stages
200 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
201 MACHINE_ARCH=${TARGET_ARCH} \
203 CPUTYPE=${TARGET_CPUTYPE} \
204 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
205 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
206 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
208 # bootstrap-tools stage
209 BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
210 PATH=${BPATH}:${PATH} \
211 WORLDTMP=${WORLDTMP} \
212 VERSION="${VERSION}" \
213 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
214 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
215 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
217 BOOTSTRAPPING=${OSRELDATE} \
218 -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
219 -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
220 -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
223 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
224 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
225 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
227 BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \
231 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
232 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
236 WMAKEENV= ${CROSSENV} \
237 _SHLIBDIRPREFIX=${WORLDTMP} \
238 VERSION="${VERSION}" \
239 INSTALL="sh ${.CURDIR}/tools/install.sh" \
241 .if ${MK_CDDL} == "no" || defined(NO_CTF)
244 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
246 .if ${TARGET_ARCH} == "amd64"
248 LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
250 .if empty(TARGET_CPUTYPE)
251 LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
253 LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
255 LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -mfancy-math-387 -DCOMPAT_32BIT \
256 -iprefix ${LIB32TMP}/usr/ \
257 -L${LIB32TMP}/usr/lib32 \
258 -B${LIB32TMP}/usr/lib32
260 # Yes, the flags are redundant.
261 LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
262 _SHLIBDIRPREFIX=${LIB32TMP} \
263 VERSION="${VERSION}" \
266 INSTALL="sh ${.CURDIR}/tools/install.sh" \
268 CC="${CC} ${LIB32FLAGS}" \
269 CXX="${CXX} ${LIB32FLAGS}" \
270 OBJC="${OBJC} ${LIB32FLAGS}" \
271 LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
276 LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
277 -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \
278 -DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP}
279 LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
283 .if empty(.MAKEFLAGS:M-n)
284 IMAKEENV= ${CROSSENV} \
285 PATH=${STRICTTMPPATH}:${INSTALLTMP}
287 IMAKEENV= ${CROSSENV} \
288 PATH=${TMPPATH}:${INSTALLTMP}
290 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
293 KMAKEENV= ${WMAKEENV}
294 KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
299 # Attempt to rebuild the entire system, with reasonable chance of
300 # success, regardless of how old your existing system is.
303 .if ${.CURDIR:C/[^,]//g} != ""
304 # The m4 build of sendmail files doesn't like it if ',' is used
305 # anywhere in the path of it's files.
307 @echo "*** Error: path to source tree contains a comma ','"
312 @echo "--------------------------------------------------------------"
313 @echo ">>> Rebuilding the temporary build tree"
314 @echo "--------------------------------------------------------------"
315 .if !defined(NO_CLEAN)
317 .if ${TARGET_ARCH} == "amd64"
321 rm -rf ${WORLDTMP}/legacy/usr/include
322 # XXX - These three can depend on any header file.
323 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
324 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
325 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
328 usr/bin usr/games usr/include/sys usr/lib \
329 usr/libexec usr/sbin usr/share/dict \
330 usr/share/groff_font/devX100 \
331 usr/share/groff_font/devX100-12 \
332 usr/share/groff_font/devX75 \
333 usr/share/groff_font/devX75-12 \
334 usr/share/groff_font/devascii \
335 usr/share/groff_font/devcp1047 \
336 usr/share/groff_font/devdvi \
337 usr/share/groff_font/devhtml \
338 usr/share/groff_font/devkoi8-r \
339 usr/share/groff_font/devlatin1 \
340 usr/share/groff_font/devlbp \
341 usr/share/groff_font/devlj4 \
342 usr/share/groff_font/devps \
343 usr/share/groff_font/devutf8 \
344 usr/share/tmac/mdoc usr/share/tmac/mm
345 mkdir -p ${WORLDTMP}/legacy/${_dir}
348 lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
349 usr/libexec usr/sbin usr/share/misc
350 mkdir -p ${WORLDTMP}/${_dir}
352 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
353 -p ${WORLDTMP}/usr/include >/dev/null
354 ln -sf ${.CURDIR}/sys ${WORLDTMP}
355 .if ${MK_BIND_LIBS} != "no"
356 mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \
357 -p ${WORLDTMP}/usr/include >/dev/null
361 @echo "--------------------------------------------------------------"
362 @echo ">>> stage 1.1: legacy release compatibility shims"
363 @echo "--------------------------------------------------------------"
364 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy
367 @echo "--------------------------------------------------------------"
368 @echo ">>> stage 1.2: bootstrap tools"
369 @echo "--------------------------------------------------------------"
370 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
372 .if !defined(NO_CLEAN)
374 @echo "--------------------------------------------------------------"
375 @echo ">>> stage 2.1: cleaning up the object tree"
376 @echo "--------------------------------------------------------------"
377 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
378 .if ${TARGET_ARCH} == "amd64"
379 ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
384 @echo "--------------------------------------------------------------"
385 @echo ">>> stage 2.2: rebuilding the object tree"
386 @echo "--------------------------------------------------------------"
387 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj
390 @echo "--------------------------------------------------------------"
391 @echo ">>> stage 2.3: build tools"
392 @echo "--------------------------------------------------------------"
393 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
396 @echo "--------------------------------------------------------------"
397 @echo ">>> stage 3: cross tools"
398 @echo "--------------------------------------------------------------"
399 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
402 @echo "--------------------------------------------------------------"
403 @echo ">>> stage 4.1: building includes"
404 @echo "--------------------------------------------------------------"
405 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
408 @echo "--------------------------------------------------------------"
409 @echo ">>> stage 4.2: building libraries"
410 @echo "--------------------------------------------------------------"
411 ${_+_}cd ${.CURDIR}; \
412 ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
413 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE libraries
416 @echo "--------------------------------------------------------------"
417 @echo ">>> stage 4.3: make dependencies"
418 @echo "--------------------------------------------------------------"
419 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend
422 @echo "--------------------------------------------------------------"
423 @echo ">>> stage 4.4: building everything"
424 @echo "--------------------------------------------------------------"
425 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all
426 .if ${TARGET_ARCH} == "amd64"
429 @echo "--------------------------------------------------------------"
430 @echo ">>> stage 5.1: building 32 bit shim libraries"
431 @echo "--------------------------------------------------------------"
433 usr/include usr/lib32 usr/share/misc
434 mkdir -p ${LIB32TMP}/${_dir}
436 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
437 -p ${LIB32TMP}/usr/include >/dev/null
439 ln -sf ${.CURDIR}/sys ${WORLDTMP}
440 .if ${MK_KERBEROS} != "no"
441 .for _t in obj depend all
442 cd ${.CURDIR}/kerberos5/tools; \
443 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= ${_t}
446 .for _t in obj includes
447 cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
448 cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
449 .if ${MK_CDDL} != "no"
450 cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t}
452 cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t}
453 .if ${MK_CRYPT} != "no"
454 cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t}
456 .if ${MK_KERBEROS} != "no"
457 cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t}
460 .for _dir in usr.bin/lex/lib
461 cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj
463 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
464 cd ${.CURDIR}/${_dir}; \
465 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= build-tools
468 ${LIB32WMAKE} -f Makefile.inc1 libraries
469 .for _t in obj depend all
470 cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
471 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t}
474 distribute32 install32:
475 .if make(distribute32)
476 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree
477 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32/dtrace # XXX add to mtree
479 mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree
480 mkdir -p ${DESTDIR}/usr/lib32/dtrace # XXX add to mtree
482 cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
483 .if ${MK_CDDL} != "no"
484 cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
486 cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
487 .if ${MK_CRYPT} != "no"
488 cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
490 .if ${MK_KERBEROS} != "no"
491 cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
493 cd ${.CURDIR}/libexec/rtld-elf; \
494 PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
495 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//}
499 .if !defined(SUBDIR_OVERRIDE)
500 WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools
502 WMAKE_TGTS+= _cleanobj _obj _build-tools
503 .if !defined(SUBDIR_OVERRIDE)
504 WMAKE_TGTS+= _cross-tools
506 WMAKE_TGTS+= _includes _libraries _depend everything
507 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
511 buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
512 .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
515 @echo "--------------------------------------------------------------"
516 @echo ">>> World build started on `LC_ALL=C date`"
517 @echo "--------------------------------------------------------------"
521 @echo "--------------------------------------------------------------"
522 @echo ">>> World build completed on `LC_ALL=C date`"
523 @echo "--------------------------------------------------------------"
526 # We need to have this as a target because the indirection between Makefile
527 # and Makefile.inc1 causes the correct PATH to be used, rather than a
528 # modification of the current environment's PATH. In addition, we need
529 # to quote multiword values.
535 @echo Entering world for ${TARGET_ARCH}:${TARGET}
536 @cd ${.CURDIR} && env ${WMAKEENV} sh || true
538 TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
539 toolchain: ${TOOLCHAIN_TGTS}
540 kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
545 # Checks to be sure system is ready for installworld/installkernel.
550 # Require DESTDIR to be set if installing for a different architecture.
552 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE}
553 .if !make(distributeworld)
554 installcheck: installcheck_DESTDIR
555 installcheck_DESTDIR:
556 .if !defined(DESTDIR) || empty(DESTDIR)
557 @echo "ERROR: Please set DESTDIR!"; \
564 # Check for missing UIDs/GIDs.
568 .if ${MK_SENDMAIL} != "no"
574 CHECK_GIDS+= proxy authpf
576 installcheck: installcheck_UGID
578 .for uid in ${CHECK_UIDS}
579 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
580 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
584 .for gid in ${CHECK_GIDS}
585 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
586 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
594 # Distributes everything compiled by a `buildworld'.
598 # Installs everything compiled by a 'buildworld'.
600 .if ${MK_INFO} != "no"
601 _install-info= install-info
604 distributeworld installworld: installcheck
605 mkdir -p ${INSTALLTMP}
606 for prog in [ awk cap_mkdb cat chflags chmod chown \
607 date echo egrep find grep ${_install-info} \
608 ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
609 test true uname wc zic; do \
610 cp `which $$prog` ${INSTALLTMP}; \
612 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
618 # If you have a build server, you can NFS mount the source and obj directories
619 # and do a 'make reinstall' on the *client* to install new binaries from the
620 # most recent server build.
623 @echo "--------------------------------------------------------------"
624 @echo ">>> Making hierarchy"
625 @echo "--------------------------------------------------------------"
626 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
628 @echo "--------------------------------------------------------------"
629 @echo ">>> Installing everything"
630 @echo "--------------------------------------------------------------"
631 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
632 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
633 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
637 @echo "--------------------------------------------------------------"
638 @echo ">>> Distributing everything"
639 @echo "--------------------------------------------------------------"
640 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
641 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
642 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
646 distrib-dirs distribution:
647 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET}
650 # buildkernel and installkernel
652 # Which kernels to build and/or install is specified by setting
653 # KERNCONF. If not defined a GENERIC kernel is built/installed.
654 # Only the existing (depending TARGET) config files are used
655 # for building kernels and only the first of these is designated
656 # as the one being installed.
658 # Note that we have to use TARGET instead of TARGET_ARCH when
659 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
660 # be set to cross-build, we have to make sure TARGET is set
663 .if !defined(KERNCONF) && defined(KERNEL)
669 INSTKERNNAME?= kernel
671 KERNSRCDIR?= ${.CURDIR}/sys
672 KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
673 KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
674 KERNCONFDIR?= ${KRNLCONFDIR}
678 .for _kernel in ${KERNCONF}
679 .if exists(${KERNCONFDIR}/${_kernel})
680 BUILDKERNELS+= ${_kernel}
681 .if empty(INSTALLKERNEL)
682 INSTALLKERNEL= ${_kernel}
690 # Builds all kernels defined by BUILDKERNELS.
693 .if empty(BUILDKERNELS)
694 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
697 .if defined(KERNWARN)
698 @echo "--------------------------------------------------------------"
699 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
700 @echo "--------------------------------------------------------------"
704 .for _kernel in ${BUILDKERNELS}
705 @echo "--------------------------------------------------------------"
706 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
707 @echo "--------------------------------------------------------------"
708 @echo "===> ${_kernel}"
709 mkdir -p ${KRNLOBJDIR}
710 .if !defined(NO_KERNELCONFIG)
712 @echo "--------------------------------------------------------------"
713 @echo ">>> stage 1: configuring the kernel"
714 @echo "--------------------------------------------------------------"
717 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
718 ${KERNCONFDIR}/${_kernel}
720 .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
722 @echo "--------------------------------------------------------------"
723 @echo ">>> stage 2.1: cleaning up the object tree"
724 @echo "--------------------------------------------------------------"
725 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
728 @echo "--------------------------------------------------------------"
729 @echo ">>> stage 2.2: rebuilding the object tree"
730 @echo "--------------------------------------------------------------"
731 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
733 @echo "--------------------------------------------------------------"
734 @echo ">>> stage 2.3: build tools"
735 @echo "--------------------------------------------------------------"
736 cd ${KRNLOBJDIR}/${_kernel}; \
737 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
738 ${MAKE} -DNO_CPU_CFLAGS -DNO_CTF \
739 -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
740 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
741 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
742 .for target in obj depend all
743 cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
744 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
745 ${MAKE} -DNO_CPU_CFLAGS -DNO_CTF ${target}
748 .if !defined(NO_KERNELDEPEND)
750 @echo "--------------------------------------------------------------"
751 @echo ">>> stage 3.1: making dependencies"
752 @echo "--------------------------------------------------------------"
753 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
756 @echo "--------------------------------------------------------------"
757 @echo ">>> stage 3.2: building everything"
758 @echo "--------------------------------------------------------------"
759 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
760 @echo "--------------------------------------------------------------"
761 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
762 @echo "--------------------------------------------------------------"
766 # installkernel, etc.
768 # Install the kernel defined by INSTALLKERNEL
770 installkernel installkernel.debug \
771 reinstallkernel reinstallkernel.debug: installcheck
772 .if empty(INSTALLKERNEL)
773 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
776 @echo "--------------------------------------------------------------"
777 @echo ">>> Installing kernel"
778 @echo "--------------------------------------------------------------"
779 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
780 ${CROSSENV} PATH=${TMPPATH} \
781 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
786 # Build the API documentation with doxygen
789 @if [ ! -x `/usr/bin/which doxygen` ]; then \
790 echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
793 cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
798 # Update the source tree, by running cvsup and/or running cvs to update to the
802 .if defined(SUP_UPDATE)
803 @echo "--------------------------------------------------------------"
804 @echo ">>> Running ${SUP}"
805 @echo "--------------------------------------------------------------"
807 @${SUP} ${SUPFLAGS} ${SUPFILE}
809 .if defined(SUPFILE1)
810 @${SUP} ${SUPFLAGS} ${SUPFILE1}
812 .if defined(SUPFILE2)
813 @${SUP} ${SUPFLAGS} ${SUPFILE2}
815 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
816 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
818 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
819 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
822 .if defined(CVS_UPDATE)
823 @echo "--------------------------------------------------------------"
824 @echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT}
825 @echo "--------------------------------------------------------------"
826 cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS}
830 # ------------------------------------------------------------------------
832 # From here onwards are utility targets used by the 'make world' and
833 # related targets. If your 'world' breaks, you may like to try to fix
834 # the problem and manually run the following targets to attempt to
835 # complete the build. Beware, this is *not* guaranteed to work, you
836 # need to have a pretty good grip on the current state of the system
837 # to attempt to manually finish it. If in doubt, 'make world' again.
841 # legacy: Build compatibility shims for the next three targets
844 .if ${BOOTSTRAPPING} < 503000
845 @echo "ERROR: Source upgrades from versions prior to 5.3 not supported."; \
848 .for _tool in tools/build
849 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
850 cd ${.CURDIR}/${_tool}; \
851 ${MAKE} DIRPRFX=${_tool}/ obj; \
852 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
853 ${MAKE} DIRPRFX=${_tool}/ depend; \
854 ${MAKE} DIRPRFX=${_tool}/ all; \
855 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
859 # bootstrap-tools: Build tools needed for compatibility
861 .if ${MK_GAMES} != "no"
862 _strfile= games/fortune/strfile
865 .if ${MK_CXX} != "no"
866 _gperf= gnu/usr.bin/gperf
867 .if ${BOOTSTRAPPING} < 700004
868 _groff= gnu/usr.bin/groff
870 _groff= gnu/usr.bin/groff/tmac
874 .if ${BOOTSTRAPPING} < 600029
875 _texinfo= gnu/usr.bin/texinfo
878 .if ${BOOTSTRAPPING} < 600015
879 _cap_mkdb= usr.bin/cap_mkdb
882 .if ${BOOTSTRAPPING} < 600018
883 _colldef= usr.bin/colldef
886 .if ${BOOTSTRAPPING} < 600017
887 _gencat= usr.bin/gencat
890 .if ${BOOTSTRAPPING} < 600016
891 _mklocale= usr.bin/mklocale
894 .if ${BOOTSTRAPPING} < 700018
895 _gensnmptree= usr.sbin/bsnmpd/gensnmptree
898 .if ${MK_RESCUE} != "no" && \
899 ${BOOTSTRAPPING} < 700026
900 _crunchgen= usr.sbin/crunch/crunchgen
903 .if ${BOOTSTRAPPING} < 600020
904 _pwd_mkdb= usr.sbin/pwd_mkdb
907 #.if ${MK_CDDL} != "no"
908 #_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
909 # lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
931 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
932 cd ${.CURDIR}/${_tool}; \
933 ${MAKE} DIRPRFX=${_tool}/ obj; \
934 ${MAKE} DIRPRFX=${_tool}/ depend; \
935 ${MAKE} DIRPRFX=${_tool}/ all; \
936 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
940 # build-tools: Build special purpose build tools
942 .if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
943 _aicasm= sys/modules/aic7xxx/aicasm
946 .if !defined(NO_SHARE)
947 _share= share/syscons/scrnmaps
950 .if ${MK_KERBEROS} != "no"
951 _kerberos5_tools= kerberos5/tools
954 .if ${MK_RESCUE} != "no"
955 _rescue= rescue/rescue
963 lib/ncurses/ncurses \
964 lib/ncurses/ncursesw \
970 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
971 cd ${.CURDIR}/${_tool}; \
972 ${MAKE} DIRPRFX=${_tool}/ obj; \
973 ${MAKE} DIRPRFX=${_tool}/ build-tools
976 gnu/usr.bin/cc/cc_tools \
978 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
979 cd ${.CURDIR}/${_tool}; \
980 ${MAKE} DIRPRFX=${_tool}/ obj; \
981 ${MAKE} DIRPRFX=${_tool}/ depend; \
982 ${MAKE} DIRPRFX=${_tool}/ all
986 # cross-tools: Build cross-building tools
988 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
989 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
990 _btxld= usr.sbin/btxld
992 .if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
993 _crunchide= usr.sbin/crunch/crunchide
995 .if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR)
996 _kgzip= usr.sbin/kgzip
1002 gnu/usr.bin/binutils \
1005 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
1009 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1010 cd ${.CURDIR}/${_tool}; \
1011 ${MAKE} DIRPRFX=${_tool}/ obj; \
1012 ${MAKE} DIRPRFX=${_tool}/ depend; \
1013 ${MAKE} DIRPRFX=${_tool}/ all; \
1014 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
1018 # hierarchy - ensure that all the needed directories are present
1021 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
1024 # libraries - build all libraries, and install them under ${DESTDIR}.
1026 # The list of libraries with dependents (${_prebuild_libs}) and their
1027 # interdependencies (__L) are built automatically by the
1028 # ${.CURDIR}/tools/make_libdeps.sh script.
1032 ${MAKE} -f Makefile.inc1 _prereq_libs; \
1033 ${MAKE} -f Makefile.inc1 _startup_libs; \
1034 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
1035 ${MAKE} -f Makefile.inc1 _generic_libs;
1038 # static libgcc.a prerequisite for shared libc
1040 _prereq_libs= gnu/lib/libgcc
1042 # These dependencies are not automatically generated:
1044 # gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
1045 # all shared libraries for ELF.
1047 _startup_libs= gnu/lib/csu
1048 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
1049 _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
1051 _startup_libs+= lib/csu/${MACHINE_ARCH}
1053 _startup_libs+= gnu/lib/libgcc
1054 _startup_libs+= lib/libc
1056 gnu/lib/libgcc__L: lib/libc__L
1058 _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
1059 ${_kerberos5_lib_libroken} \
1060 lib/libbz2 lib/libcom_err lib/libcrypt lib/libexpat \
1061 ${_lib_libgssapi} ${_lib_libipx} \
1062 lib/libkiconv lib/libkvm lib/libmd \
1063 lib/ncurses/ncurses lib/ncurses/ncursesw \
1064 lib/libopie lib/libpam ${_default_thread_lib} \
1065 lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
1066 ${_lib_libypclnt} lib/libz lib/msun \
1067 ${_secure_lib_libcrypto} ${_secure_lib_libssh} \
1068 ${_secure_lib_libssl} lib/libdwarf lib/libproc
1070 .if ${MK_LIBTHR} != "no" && ${MK_LIBKSE} != "no"
1071 _default_thread_lib= lib/${DEFAULT_THREAD_LIB}
1072 .elif ${MK_LIBTHR} != "no"
1073 _default_thread_lib= lib/libthr
1074 .elif ${MK_LIBKSE} != "no"
1075 _default_thread_lib= lib/libkse
1078 _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib
1080 lib/libopie__L lib/libtacplus__L: lib/libmd__L
1082 .if ${MK_CDDL} != "no"
1086 .if ${MK_CRYPT} != "no"
1087 .if ${MK_OPENSSL} != "no"
1088 _secure_lib_libcrypto= secure/lib/libcrypto
1089 _secure_lib_libssl= secure/lib/libssl
1090 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
1091 .if ${MK_OPENSSH} != "no"
1092 _secure_lib_libssh= secure/lib/libssh
1093 secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
1094 .if ${MK_KERBEROS} != "no"
1095 secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
1096 kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \
1097 kerberos5/lib/libroken__L
1101 _secure_lib= secure/lib
1104 .if ${MK_IPX} != "no"
1105 _lib_libipx= lib/libipx
1108 .if ${MK_KERBEROS} != "no"
1109 _kerberos5_lib= kerberos5/lib
1110 _kerberos5_lib_libasn1= kerberos5/lib/libasn1
1111 _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
1112 _kerberos5_lib_libroken= kerberos5/lib/libroken
1113 _lib_libgssapi= lib/libgssapi
1116 .if ${MK_NIS} != "no"
1117 _lib_libypclnt= lib/libypclnt
1120 .if ${MK_OPENSSL} == "no"
1121 lib/libradius__L: lib/libmd__L
1124 .for _lib in ${_prereq_libs}
1126 .if exists(${.CURDIR}/${_lib})
1127 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1128 cd ${.CURDIR}/${_lib}; \
1129 ${MAKE} DIRPRFX=${_lib}/ obj; \
1130 ${MAKE} DIRPRFX=${_lib}/ depend; \
1131 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
1132 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
1136 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
1138 .if exists(${.CURDIR}/${_lib})
1139 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1140 cd ${.CURDIR}/${_lib}; \
1141 ${MAKE} DIRPRFX=${_lib}/ obj; \
1142 ${MAKE} DIRPRFX=${_lib}/ depend; \
1143 ${MAKE} DIRPRFX=${_lib}/ all; \
1144 ${MAKE} DIRPRFX=${_lib}/ install
1148 # libpam is special: we need to build static PAM modules before
1149 # static PAM library, and dynamic PAM library before dynamic PAM
1151 lib/libpam__L: .PHONY
1152 ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
1153 cd ${.CURDIR}/lib/libpam; \
1154 ${MAKE} DIRPRFX=lib/libpam/ obj; \
1155 ${MAKE} DIRPRFX=lib/libpam/ depend; \
1156 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
1157 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
1159 _prereq_libs: ${_prereq_libs:S/$/__PL/}
1160 _startup_libs: ${_startup_libs:S/$/__L/}
1161 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1162 _generic_libs: ${_generic_libs:S/$/__L/}
1164 .for __target in all clean cleandepend cleandir depend includes obj
1165 .for entry in ${SUBDIR}
1166 ${entry}.${__target}__D: .PHONY
1167 ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1168 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \
1169 edir=${entry}.${MACHINE_ARCH}; \
1170 cd ${.CURDIR}/$${edir}; \
1172 ${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \
1174 cd ${.CURDIR}/$${edir}; \
1176 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1178 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
1181 .include <bsd.subdir.mk>
1183 .if make(check-old) || make(check-old-dirs) || \
1184 make(check-old-files) || make(check-old-libs) || \
1185 make(delete-old) || make(delete-old-dirs) || \
1186 make(delete-old-files) || make(delete-old-libs)
1189 # check for / delete old files section
1192 .include "ObsoleteFiles.inc"
1194 OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
1195 else you can not start such an application. Consult UPDATING for more \
1196 information regarding how to cope with the removal/revision bump of a \
1199 .if !defined(BATCH_DELETE_OLD_FILES)
1206 @echo ">>> Removing old files (only deletes safe to delete libs)"
1207 # Ask for every old file if the user really wants to remove it.
1208 # It's annoying, but better safe than sorry.
1209 @for file in ${OLD_FILES}; do \
1210 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1211 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1212 rm ${RM_I} "${DESTDIR}/$${file}"; \
1215 # Remove catpages without corresponding manpages.
1217 find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1218 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1219 while read catpage; do \
1221 if [ ! -e "$${manpage}" ]; then \
1222 rm ${RM_I} $${catpage} <&3 ; \
1225 @echo ">>> Old files removed"
1228 @echo ">>> Checking for old files"
1229 @for file in ${OLD_FILES}; do \
1230 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1231 echo "${DESTDIR}/$${file}"; \
1234 # Check for catpages without corresponding manpages.
1235 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1236 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1237 while read catpage; do \
1239 if [ ! -e "$${manpage}" ]; then \
1240 echo $${catpage} ; \
1245 @echo ">>> Removing old libraries"
1246 @echo "${OLD_LIBS_MESSAGE}" | fmt
1247 @for file in ${OLD_LIBS}; do \
1248 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1249 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1250 rm ${RM_I} "${DESTDIR}/$${file}"; \
1253 @echo ">>> Old libraries removed"
1256 @echo ">>> Checking for old libraries"
1257 @for file in ${OLD_LIBS}; do \
1258 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1259 echo "${DESTDIR}/$${file}"; \
1264 @echo ">>> Removing old directories"
1265 @for dir in ${OLD_DIRS}; do \
1266 if [ -d "${DESTDIR}/$${dir}" ]; then \
1267 rmdir -v "${DESTDIR}/$${dir}" || true; \
1268 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1269 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1272 @echo ">>> Old directories removed"
1275 @echo ">>> Checking for old directories"
1276 @for dir in ${OLD_DIRS}; do \
1277 if [ -d "${DESTDIR}/$${dir}" ]; then \
1278 echo "${DESTDIR}/$${dir}"; \
1279 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1280 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1284 delete-old: delete-old-files delete-old-dirs
1285 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1287 check-old: check-old-files check-old-libs check-old-dirs
1288 @echo "To remove old files and directories run '${MAKE} delete-old'."
1289 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1294 # showconfig - show build configuration.
1297 @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort